<script type="text/javascript">
function addTag(tag) {
    old_value = document.getElementById("spaghetti").value
    if (old_value == null || old_value.length == 0) {
        document.getElementById("spaghetti").value=tag;
    } else {
        old_value_arr = old_value.split(", ")
        index = old_value_arr.indexOf(tag);
        if (index != -1) {
            old_value_arr.splice(index, 1);
        } else {
            old_value_arr.push(tag);
        }

        document.getElementById("spaghetti").value=old_value_arr.join(", ");
    }
}
</script>
<div id="sidebar" style="padding-top: 0; margin-top: 0;width: 12em;">
  <div id="global_stats" style="padding-top: 0; margin-top: 0;">
    <%= render :partial => "global_stats", :locals => {:all_stats => @all_stats}%>
  </div>
</div>
<div id="mainContent" style="padding-top: 0; margin-top: 0;">
  <div id="controls">    
    <%= render :partial => 'controls', :locals => {:tags => @tags}%>
    </div>

  <div id="global_chart" style="text-align: center">
      <%= ziya_chart(url_for(:action => 'show_global_chart', :id => 0, :tags => @tags),
        :id => 'my_bar', :bgcolor => "#eecc88", 
        :width => 600, :height => 350, 
        :align => 'center' ) %>
  </div>
  <p align="center">
    <!-- end #mainContent -->
  </p>
</div>
<div id="individual_stats" style="text-align: center;float: right">
  
</div>



